public class USBTest {
    public static void main(String[] args) {
        Computer computer = new Computer();
        Printer printer = new Printer();

        computer.transferData(printer);
    }
    
}

@Deprecated(since = "1.8")
class Computer {
    public void transferData (USB usb) {  //接口存在多态性： USB usb = new Printer();
        System.out.println("设备连接成功...");
        usb.start();

        System.out.println("数据传输的细节操作...");
        usb.stop();
    }
}

class Printer implements USB{
    public void start() {
        System.out.println("打印机开始工作");
    }

    public void stop() {
        System.out.println("打印机停止工作");
    }
}

/**USB
 */
interface USB {
    //方法
    void start();
    void stop();


    
}